<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 1.用户输入总秒数
    let second = +prompt('请输入总秒数:')
    // 2.计算时分秒，里面包含数字补0
    function getTime(t) {
      // console.log(t)
      let h = parseInt(t / 60 / 60 % 24)
      let m = parseInt(t / 60 % 60)
      let s = parseInt(t % 60)
      h = h < 10 ? '0' + h : h
      m = m < 10 ? '0' + m : m
      s = s < 10 ? '0' + s : s
      return `转换之后是${h}小时${m}分${s}秒`
    }

    let str = getTime(second)
    document.write(str)

  </script>
</body>
</html>